﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOT4Week1Day1.Domain.Models
{
    /// <summary>
    /// 数据字典项
    /// </summary>
    public class DictData
    {
        [Key]
        public int DId { get; set; }

        /// <summary>
        /// 外键关联字典表的主键
        /// </summary>
        [ForeignKey("DictKey")]
        public int KId { get; set; }
        
        /// <summary>
        /// 字典项名称
        /// </summary>
        [Required]
        [StringLength(30)]
        public string DictDataName { get; set; }

        /// <summary>
        /// 字典项的代码
        /// </summary>
        [Required]
        [StringLength(10)]
        public string DictDataCode { get; set; }

        /// <summary>
        /// 字典项的备注
        /// </summary>
        [StringLength(100)]
        public string Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }

        //导航属性
        public virtual DictKey  DictKey { get; set; }
    }
}
